package logic.courseQuery_logic;

import java.util.LinkedList;
import java.util.List;

import javaRMI.RMIClient;
import logic.utility_logic.CourseProduceLogicsvFactory;
import logicsv.courseProduce_logicsv.CourseProduceLogicsv;
import vo.CourseVO;
import datasv.courseQuery_datasv.CourseQueryDatasv;
import datasv.datafactorysv.CourseQueryDatasvFactory;

public class SubModelCourseList {
	private CourseQueryDatasv courseQD ;
	private CourseProduceLogicsv coursePL;
	public SubModelCourseList(RMIClient rmi){
		courseQD = new CourseQueryDatasvFactory(rmi).create();
		coursePL = new CourseProduceLogicsvFactory(rmi).create();
	}
	public List<CourseVO> getAllCouOfSubModel(String collegeID, String modelID,
			String subModelID){
		List<String> list = courseQD.getAllCouOfSubModel(collegeID, modelID, subModelID);
		
//		System.out.println(list);
		
		LinkedList<CourseVO> courses = new LinkedList<CourseVO>();
		for(String id : list){
			courses.add(coursePL.getCourse(id));
		}
		return courses;
	}
}
